﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using CardGamesLibrary.Cards;
using CardGamesLibrary.Turns;

namespace CardGamesLibrary
{
    /// <summary>
    /// This is the base class for all players.
    /// </summary>
    public class Player : INotifyPropertyChanged
    {
        public Player(string name,  bool isComputer)
        {
            Name = name;
            //Hand = new Hand();
            IsComputer = isComputer;
        }

        /// <summary>
        /// Gets or sets the name.
        /// </summary>
        /// <value>The name.</value>
        public string Name
        {
            get; set;
        }

        ///// <summary>
        ///// Gets or sets the hand.
        ///// </summary>
        ///// <value>The hand.</value>
        //public Hand Hand
        //{
        //    get; set;
        //}

        /// <summary>
        /// Gets or sets a value indicating whether this instance is computer.
        /// </summary>
        /// <value>
        /// 	<c>true</c> if this instance is computer; otherwise, <c>false</c>.
        /// </value>
        public bool IsComputer
        {
            get; set;
        }

        /// <summary>
        /// Plays the turn.
        /// </summary>
        /// <param name="turn">The turn.</param>
        /// <returns></returns>
        public PlayerTurn PlayTurn(PlayerTurn turn)
        {
            return turn;
        }

        public event PropertyChangedEventHandler PropertyChanged;

        public void InvokePropertyChanged(PropertyChangedEventArgs e)
        {
            var handler = PropertyChanged;

            if (handler != null) 
                handler(this, e);
        }
        public void InvokePropertyChanged(string propertyName)
        {
            InvokePropertyChanged(new PropertyChangedEventArgs(propertyName));
        }
    }
}
